package model

import "gorm.io/gorm"

type PermissionFillAble struct {
	Uri       string `json:"uri" gorm:"comment:请求uri"`
	Method    string `json:"method" gorm:"comment:请求方式"`
	Name      string `json:"name" gorm:"comment:名称"`
	Desc      string `json:"desc" gorm:"comment:描述"`
	Group     string `json:"group" gorm:"comment:所属分组"`
	CreatedBy uint   `json:"created_by" gorm:"comment:创建人"`
	UpdatedBy uint   `json:"updated_by" gorm:"comment:更新操作人"`
	Super     int    `json:"super" gorm:"comment:超管权限"`
}

type Permission struct {
	gorm.Model
	PermissionFillAble
}

type PermissionWithChecked struct {
	Permission
	Checked bool `json:"checked" gorm:"-"`
}

type RolePermissions struct {
	Uri    string `json:"uri"`
	Method string `json:"method"`
}

type PermissionGroup struct {
	Group string `json:"group"`
}
